<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>New Detail</title>
    <link href="../css/layui.css" rel="stylesheet">
    <link href="../css/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="../css/common.css" rel="stylesheet">
    <link href="../css/newsDetail.css" rel="stylesheet">
</head>
<body>
<div class="head layui-row">
    <div class="layui-col-xs6">
        <a href="../index.html">
            <img src="../images/logo.png" id="logo"/>
        </a>
    </div>
    <div class="layui-col-xs6" style="text-align: right">
        <div class="search-box">
            <input id="search" placeholder="Search"/>
            <i class="icon-search"></i>
            <i class="icon-add-paper"></i>
            <i class="icon-setting"></i>
            <label id="username">Ttmny</label>
        </div>
    </div>
</div>
<div class="main-container" id="box">
    <div class="content-box">
        <div class="title">
            <div class="yi">译</div>
            <label>{{newContent.srcTitle}}</label>
        </div>
        <div class="title-fu">
            <div class="title-fu-left">
                <label>Source:</label>
                <label class="light-blue">{{newContent.srcSource}}</label>
                <label v-html="sentiment(newContent.sentimentId)"></label>
            </div>
            <div class="title-fu-right">
                <label>{{newContent.pubdate}}</label>
            </div>
        </div>
        <div class="content" >
            <label v-html="newContent.zhContent"></label>
        </div>
    </div>
    <div class="content-box">
        <div class="title">
            <label>{{newContent.titleEn}}</label>
        </div>
        <div class="title-fu">
            <div class="title-fu-left">
                <label>Source:</label>
                <label class="light-blue">{{newContent.srcSource}}</label>
                <label v-html="sentiment(newContent.sentimentId)"></label>
            </div>
            <div class="title-fu-right">
                <label>{{newContent.pubdate}}</label>
            </div>
        </div>
        <div class="content" >
            <label v-html="newContent.zhContent"></label>
        </div>
    </div>
</div>
<script src="../js/jquery-3.3.1.min.js"></script>
<script src="../js/vue.min.js"></script>
<script src="../js/gAjax.js"></script>
<script type="text/javascript">
    Vue.prototype.sentiment = function (value) {
        var msg = "Neutral"
        if (value == -2) {
            msg = "Negative+";
        } else if (value == -1) {
            msg = "Negative";
        } else if (value == 1) {
            msg = "Positive";
        } else if (value == 2) {
            msg = "Positive+";
        }
        return msg;

    };
    var mainVue = new Vue({
        el: '#box',
        data: {
            newContent: {}
        },
        mounted: function () {
            var _this = this;
            var uuid = getUrlParam("uuid");
            $.post("http://test.crgood.cn/Article/InformationDetails/inquire.do?informationId=" + uuid, function (result) {
                console.log(JSON.parse(result.data).data)
                _this.newContent = JSON.parse(result.data).data;

            });
        },
        methods: {}
    });
</script>
</body>
</html>